package com.robot.mannge.common.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.IsKey;
import com.gitee.sunchenbin.mybatis.actable.annotation.IsNotNull;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

/**
 * @Auther: mileswan
 * @Description:
 */
@Data
public class BaseDO {
	/**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @Column(name = "id", comment = "分布式唯一id")
    @IsNotNull
    @IsKey
	protected Long id;

	/**
	 * 创建时间
	 */
	@TableField(value = "gmt_create", fill = FieldFill.INSERT)
	@Column(name = "gmt_create", type = MySqlTypeConstant.DATETIME, comment = "创建时间")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	protected LocalDateTime gmtCreate;
	/**
	 * 更新时间
	 */
	@TableField(value = "gmt_modified", fill = FieldFill.INSERT_UPDATE)
	@Column(name = "gmt_modified", type = MySqlTypeConstant.DATETIME, comment = "更新时间")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	protected LocalDateTime gmtModified;

}
